package com.zenika.zentracker.hibernate.info;

import java.io.Serializable;

public class UpdatedObjectInfo {

    private Object entity;
    private Serializable id;
    private String propertyName;
    private String previousValue;
    private String newValue;
    
    public UpdatedObjectInfo(Object entity, Serializable id) {
        this.entity = entity;
        this.id = id;
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        
        buffer.append("Dirty [").append(entity).append("] with ID [").append(id).append("] ");
        buffer.append("has a dirty property [").append(propertyName);
        buffer.append("] Previous value [").append(previousValue).append("], current value [");
        buffer.append(newValue).append("]");
        
        return buffer.toString();
    }
    
    public Object getEntity() {
        return entity;
    }


    public void setEntity(Object entity) {
        this.entity = entity;
    }


    public Serializable getId() {
        return id;
    }


    public void setId(Serializable id) {
        this.id = id;
    }


    public String getPropertyName() {
        return propertyName;
    }


    public void setPropertyName(String propertyName) {
        this.propertyName = propertyName;
    }


    public String getPreviousValue() {
        return previousValue;
    }


    public void setPreviousValue(String previousValue) {
        this.previousValue = previousValue;
    }


    public String getNewValue() {
        return newValue;
    }


    public void setNewValue(String newValue) {
        this.newValue = newValue;
    }

    
}
